package com.lvhx.springboot.sofarpc;

import com.lvhx.facade.QueryTransService;
import com.lvhx.facade.dto.QueryBalInfoRequest;
import com.lvhx.facade.dto.QueryBalInfoResponse;
import com.lvhx.springboot.entity.batch.Acctbal;
import com.lvhx.springboot.mapper.batch.AcctbalMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
public class QueryTransServiceImpl implements QueryTransService {
    @Autowired
    private AcctbalMapper acctbalMapper;

    @Override
    public QueryBalInfoResponse queryBalInfo(QueryBalInfoRequest request) {
        log.info("=====查询账户余额信息入参：{}", request);
        Acctbal acctbal = acctbalMapper.selectByPrimaryKey(request.getAcctNbr());
        QueryBalInfoResponse response = new QueryBalInfoResponse();
        response.setBal(acctbal.getAmt());
        response.setAcctNbr(acctbal.getAcctnbr());
        return response;
    }
}
